#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>

int main() {
	int arr[10],length=0,check;
	for (length = 0; length < 10; length++)
	{
		int input;
		check = scanf("%d%*c", &input);
		if (check<1||input<0)
		{
			break;
		}
		arr[length] = input;
	}
	for (int i = 0; i < length; i++)
	{
		for (int j = 0; j < length - i - 1; j++)
		{
			if (arr[j] > arr[j + 1])
			{
				int cache = arr[j];
				arr[j] = arr[j + 1];
				arr[j + 1] = cache;
			}
		}
	}
	int* p = arr;
	for (int i = 0; i < length; i++)
	{
		if (*(p + i) % 2 == 1)
		{
			printf("%d ", *(p + i));
		}
	}
	for (int i = 0; i < length; i++)
	{
		if (*(p + i) % 2 == 0)
		{
			printf("%d ", *(p + i));
		}
	}
	printf("\n");
	return 0;
}